const {Article} = require('../../model/article')
const {Comment} = require('../../model/comment')
module.exports = async (req,res)=>{
    let id = req.query.id
    let result = await Article.findOne({_id:id}).populate('author')
    let resComments = await Comment.find({aid:id}).populate('uid')
    res.render('../views/home/article',{
        result,
        resComments
    })
}